﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Proggy.Web.Cms.ContentModel;
using Proggy.Web.Cms.Core;
using Newtonsoft.Json;
using Proggy.Web.Cms.Core.PropertyTypes;
using Proggy.Web.Cms.Core.Configuration.ConfigObjects;
using Proggy.Web.Cms.Core.Models;
using Proggy.Web.Cms.Repositories.Published;
using Proggy.Web.Cms.Repositories.ContentModel;
using Proggy.Web.Cms.Repositories.Membership;

namespace Proggy.Web.Cms.Core.ContentModels
{
    public abstract class ProggyCoreContentModelBase : ContentModelBase, IContentModel
    {
        public ProggyCoreContentModelBase(IContentModelTypeRepository cmRepo, IMembershipRepository membRepo) : base(cmRepo, membRepo) { }
        public ProggyCoreContentModelBase() : base() { }

        /// <summary>
        /// If value is true, will be hidden from auto-menus
        /// </summary>
        [ContentModelPropertyType("Menu", "Hide from menus", "HideFromMenuObject")]
        public TrueOrFalse HideFromMenuObject { get; set; }

        /// <summary>
        /// If true, will be hidden from auto-menus
        /// </summary>
        [JsonIgnore]
        public bool HideFromMenu { get { return this.HideFromMenuObject.SavedValue; } }
    }
}
